#include "wells.h"


wells::wells(int id_, QString name_) {
	id = id_;
	name = name_;
	timeLeft = 0;
}

wells::wells() {
	timeLeft = 3;
}

QString wells::getStringState() const {
		switch(state) {
		case -2:
			return "???";
		case -1:
			return "???"; 
		break;
		case 0:
			return "Stopped State";
		break;
		case 1:
			return "Pumping Normal State";
		break;
		case 2:
			return "Pumpoff SetPoint State";
		break;
		case 3:
			return "Malfunction State";
		break;
		default:
			return "???";
		break;
	}
}

QString wells::getStringAlarms() const {
	QString alarm = "";
	
	if(alarms[0] == 1) {
		alarm += "No Cranck";
	}
	
	if(alarms[1] == 1) {
		alarm += "Belt Slippage";
	}
	
	
	if(alarms[2] == 1) {
		alarm += "VFD Peak Load Limit";
	}
	
	
	if(alarms[3] == 1) {
		alarm += "VFD Min Load Limit";
	}
	
	
	if(alarms[4] == 1) {
		alarm += "No load";
	}
	
	if(alarm == "")
		alarm = "-";
	return alarm;
}